import java.util.Random;
import java.util.Scanner;
public class GuessNumber {
    public static void main(String[] args) {
        Random un = new Random();
        int random = un.nextInt(100)+1;
        Scanner scanner = new Scanner(System.in);
        for(int i = 0; i<10;i++){
            System.out.println("请输入一个您猜测的数字: ");
            int guess = scanner.nextInt();
            if(random<guess){
                System.out.println("数字猜测太大，请您重试");
            }else if (random>guess){
                System.out.println("数字猜测太小，请您重试");
            }else{
                System.out.println("您的数字猜测成功");
                break;
            }
        }
        System.out.println("游戏结束");
    }
}
